import React from 'react'
import classNames from 'classnames'

import { View } from '@tarojs/components'

import styles from './index.module.scss'

type IType = 'hot' | 'new' | 'time'

interface ICTag {
  /**
   * 标签类型  hot 热销 new 新品
   */
  type: IType
  [key: string]: any
}
/**
 * 进行标记和分类的小标签。
 */
export default function CTag(params: ICTag) {
  const { type } = params
  return <View className={classNames([styles['c-tag'], styles[`c-tag-${type}`]])}>{params.children}</View>
}
